import request from '@/router/axios';

export const getList = () => {
	return request({
		url: '/base/sellerGoods/loadAllGoodsClass',
		method: 'post'
	})
}
//获取商品品牌
export const getGoodsBrand = (goodsClassId) => {
	return request({
		url: '/base/sellerGoods/loadGoodsBrand',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			goodsClassId
		}
	})
}
//获取商品的四级分类
export const getGoodsClassFour = (goodsClassId) => {
	return request({
		url: '/base/sellerGoods/getGoodsClassFour',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			goodsClassId
		}
	})
}


export const loadClassSpec = (goodsClassId) => {
	return request({
		url: '/base/sellerGoods/loadGoodsClassSpec',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			goodsClassId,
			"display": true
		}
	})
}
//加载店铺分类
export const getStoreCate = (storeId) => {
	return request({
		url: '/base/sellerUserGoodsClass/list',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			storeId
		}
	})
}
//加载供货商列表
export const getsupplierlist = (storeId) => {
	return request({
		url: '/base/sellerGoods/loadGoodsSupplier',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			storeId
		}
	})
}

//加载运费模板列表
export const gettemplateFre = (supplierId, storeId) => {
	return request({
		url: '/base/sellerGoods/loadTransport',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			supplierId,
			storeId
		}
	})
}


//提交数据
export const submitdata = (AddGoodsFinishParam) => {
	return request({
		url: '/base/sellerGoods/addGoodsFinish',
		method: 'post',
		// meta: {
		// 	isSerialize: true,
		// },
		data: {
			...AddGoodsFinishParam
		}
	})
}

//发布/编辑积分商品
export const addIntegralGoods = (AddGoodsFinishParam) => {
	return request({
		url: '/base/sellerGoods/addIntegralGoodsFinish',
		method: 'post',
		data: {
			...AddGoodsFinishParam
		}
	})
}

//商品编辑页面数据
export const getProductdata = (id) => {
	return request({
		url: '/base/sellerGoods/checkGoodsDetail',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			id
		}
	})
}

//获取详情的描述
export const getProductdataInfo = (goodsId) => {
	return request({
		url: '/base/sellerGoods/checkGoodsDetailInfo',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			goodsId
		}
	})
}

//添加运费模板
export const addfreightemplate = (data) => {
	return request({
		url: '/base/sellerTransport/addItem',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			...data
		}
	})
}

//编辑运费模板
export const editfreightemplate = (data) => {
	return request({
		url: '/base/sellerTransport/editItem',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data: {
			...data
		}
	})
}
//可见范围list
export const goodsSoListTree = (storeId) => {
	return request({
		url: '/base/sellerGoods/goodsSoListTree',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data:{
			storeId
		}
	})
}
//区域第四级 
export const getOrganizationMapByLevel = (data) => {
	return request({
		url: 'base/organization/getOrganizationMapByLevel',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data:data
	})
}

//配送范围 
export const getTreeSelect = () => {
	return request({
		url: '/base/area/getTreeSelect',
		method: 'post',
		meta: {
			isSerialize: true,
		},
		data:{}
	})
}
// 添加规格
export const addSpecproperty = (data) => {
	return request({
		url: '/base/sellerGoods/addSpecproperty',
		method: 'post',
		// meta: {
		// 	isSerialize: true,
		// },
		data:{
			...data
		}
	})
}
